<%
subform_id = sub_form_list_id(association: @column.name, tab_id: @tab_id, id: @parent_record.id || generated_id(@parent_record) || 99_999_999_999)
associated_form = render 'form_association_record', scope: @scope, parent_record: @parent_record, column: @column, record: @record, locked: @record.new_record? && @column.association.singular?
options = {singular: false}
if @column.association.singular?
  options[:singular] = true
else
  unless @record.new_record?
    column = active_scaffold_config_for(@record.class).columns[@record.class.primary_key]
    options[:id] = active_scaffold_input_options(column, column_scope(@column, @scope, @record))[:id]
  end
end %>
ActiveScaffold.create_associated_record_form('<%= subform_id %>','<%=escape_javascript(associated_form)%>', <%= options.to_json.html_safe %>);
